package com.easydict.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * EasyDict配置属性
 * 提供丰富的配置选项
 */
@ConfigurationProperties(prefix = "easydict")
public class EasyDictProperties {
    
    /**
     * 是否启用EasyDict功能
     */
    private boolean enabled = true;
    
    /**
     * 字典字段后缀
     */
    private String dictSuffix = "Dict";
    
    /**
     * 缓存配置
     */
    private Cache cache = new Cache();
    
    /**
     * 调试配置
     */
    private Debug debug = new Debug();
    
    // Getters and Setters
    public boolean isEnabled() {
        return enabled;
    }
    
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
    
    public String getDictSuffix() {
        return dictSuffix;
    }
    
    public void setDictSuffix(String dictSuffix) {
        this.dictSuffix = dictSuffix;
    }
    
    public Cache getCache() {
        return cache;
    }
    
    public void setCache(Cache cache) {
        this.cache = cache;
    }
    

    
    public Debug getDebug() {
        return debug;
    }
    
    public void setDebug(Debug debug) {
        this.debug = debug;
    }
    
    /**
     * 缓存配置
     */
    public static class Cache {
        private boolean enabled = true;
        private int maxSize = 1000;
        private long expireAfterWrite = 3600; // 秒
        
        public boolean isEnabled() {
            return enabled;
        }
        
        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
        
        public int getMaxSize() {
            return maxSize;
        }
        
        public void setMaxSize(int maxSize) {
            this.maxSize = maxSize;
        }
        
        public long getExpireAfterWrite() {
            return expireAfterWrite;
        }
        
        public void setExpireAfterWrite(long expireAfterWrite) {
            this.expireAfterWrite = expireAfterWrite;
        }
    }
    

    
    /**
     * 调试配置
     */
    public static class Debug {
        private boolean enabled = false;
        private boolean logResolutions = false;
        private boolean logPerformance = false;
        
        public boolean isEnabled() {
            return enabled;
        }
        
        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
        
        public boolean isLogResolutions() {
            return logResolutions;
        }
        
        public void setLogResolutions(boolean logResolutions) {
            this.logResolutions = logResolutions;
        }
        
        public boolean isLogPerformance() {
            return logPerformance;
        }
        
        public void setLogPerformance(boolean logPerformance) {
            this.logPerformance = logPerformance;
        }
    }
}
